|
|
|
|
|
|
|
The ImageList control allows you to store a group of images into a repository from which you can select these images at runtime. Each image (BMP, ICO, JPG, or other graphic file type) is stored as a part of an object created by the ImageList control. An ImageList control is a collection of these ListImage objects. Each ListImage object can contain a bitmap (BMP), an icon (ICO), a GIF, a DIB, a CUR, or a JPG file. |
|
|
|
|
|
|
|
|
Each ListImage object can be identified by its Index or Key property. The ImageList control does not show up at runtime; instead, its used by other controls that display the images contained in the collection of objects within the ImageList control. |
|
|
|
|
|
|
|
|
To set up the ImageList control at design time, select it from the toolbox and place it on a form. Dont worry about the size or where this control is locatedit will not show up on the form at runtime. To start adding pictures, click once on the control; then from the Properties windows, click the Custom property. This displays the property page for this control. Now you can begin adding pictures to the control. |
|
|
|
|
|
|
|
|
Select the Images tab and click Insert Picture to add some graphics to this control. Youll find some graphics supplied by Visual Basic if youve chosen the Custom option and selected Graphics from the setup. If you havent chosen this option, you might want to run the Visual Basic setup again and install the graphics because there are many that youll find useful. |
|
|
|
|
|
|
|
|
Examples Filename: ImageList.frm |
|
|
|
|
|
|
|
|
In the sample form shown Figure 30.1, youll see a couple of arrows that allow you to loop through all the images in the ImageList control on this form. |
|
|
|
|
|
|
|
|
Figure 30.1
The ImageList control example. |
|
|
|
|
|